<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>~/opensource/C_Study/base_00/01_key_word/typedef.c.html</title>
<meta name="Generator" content="Vim/7.3">
<meta name="plugin-version" content="vim7.3_v10">
<meta name="syntax" content="c">
<meta name="settings" content="use_css,pre_wrap">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffff; }
body { font-family: monospace; color: #000000; background-color: #ffffff; }
.Statement { color: #ffff00; }
.Comment { color: #8080ff; }
.Type { color: #00ff00; }
.Constant { color: #ff6060; }
.PreProc { color: #ff40ff; }
-->
</style>
</head>
<body>
<pre>
<span class="PreProc">#include </span><span class="Constant">&lt;stdio.h&gt;</span>
<span class="PreProc">#include </span><span class="Constant">&lt;stdlib.h&gt;</span>
<span class="PreProc">#include </span><span class="Constant">&lt;string.h&gt;</span>
<span class="PreProc">#include </span><span class="Constant">&lt;unistd.h&gt;</span>


<span class="Type">typedef</span> <span class="Type">int</span> int32;
<span class="Comment">/*</span><span class="Comment"> typedef 定义名称有什么限制  </span><span class="Comment">*/</span>
<span class="Type">typedef</span> <span class="Type">int</span>  a[<span class="Constant">10</span>];
<span class="Type">typedef</span> <span class="Type">struct</span> test {
	<span class="Type">int</span> i;
	<span class="Type">char</span> c;
} Test_st, *Ptest_st;

<span class="Type">int</span> main(<span class="Type">int</span> argc, <span class="Type">char</span>*argv[])
{
	Test_st st;
	Test_st st1;
	<span class="Type">const</span> Ptest_st pst = &amp;st; <span class="Comment">// const 修饰的是pst 会把Ptest_st 当作一个数据类型(实际它就是个数据类型)</span>
	pst= &amp;st1;

	<span class="Comment">//a[10] a[10];</span>
	<span class="Comment">//(a[10]) a;</span>
	<span class="Statement">return</span> <span class="Constant">0</span>;
}
</pre>
</body>
</html>
